/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jse;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;

/**
 *
 * @author WangShuai
 */
public class BlankLineSearch {

    public static void main(String[] args) {
        try {
            String s = FileUtils.readFileToString(new File("C:\\test.txt"));
            System.out.println(s);
            Pattern pattern = Pattern.compile("\\n\\s*\\r");
            String[] strs = pattern.split(s);
            for (int i = 0; i < strs.length; i++) {
                System.out.println("L" + i + ": " + strs[i]);
            }
        } catch (IOException ex) {
            Logger.getLogger(BlankLineSearch.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
